<template>
    <TopNavBar title="郵件地址" type="back" />
  <div class="email-page">
    <input class="email-input" type="email" v-model="email" placeholder="請輸入郵件地址" :disabled="submitted" />
    <button class="confirm-btn" :disabled="submitted" :class="{ disabled: submitted }" @click="handleSubmit">確認</button>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { showToast } from 'vant'

const email = ref('')
const submitted = ref(false)

function handleSubmit() {
  if (!email.value) return
  submitted.value = true
  showToast('提交成功')
}
</script>

<style scoped>
.email-page { 
  background: #f4f6f8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}
.email-input {
  width: 90%;
  max-width: 400px;
  height: 44px;
  border: 1px solid #e2e4e8;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 16px;
  margin-bottom: 32px;
  background: #fff;
  color: #222;
  outline: none;
  box-sizing: border-box;
}
.email-input::placeholder {
  color: #bfc3c9;
}
.confirm-btn {
  width: 90%;
  max-width: 400px;
  height: 48px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.confirm-btn:active {
  background: #222;
}
.confirm-btn.disabled,
.confirm-btn:disabled {
  background: #999;
  cursor: not-allowed;
}
</style> 